/**
 * Created by nk7181 on 2018/1/17.
 */
/*
window.onload = function () {
    /!*$().getTagName('p').css('color','green').html('aaa').click(function () {
      alert(1)
    });
    console.log($().getClass('red','bbb').getElement(2).css('color','yellow'))*!/
    //$().getId('box').addClass('a').addClass('b').addClass('a').removeClass('b');
    //$().addRule(0,'body','background: red',0)
    $().removeRule(0).removeRule(0);
}*/
/*
window.onload = function () {
    var oButton = document.getElementById('button');
    addEvent(oButton,'click',fn)
    //removeEvent(oButton,'click',fn)
}

function fn (e) {
    alert(e.clientX);
}*/
/*window.onload = function () {
    var oButton = document.getElementById('button');
    /!* addEvent(oButton,'click',fn1)
     addEvent(oButton,'click',fn2)
     addEvent(oButton,'click',fn3)
     removeEvent(oButton,'click',fn2)*!/
    var oHref = document.getElementById('href');
    addEvent(oHref,'click',function (e) {
        alert('a')
        e.preventDefault();
    })
    addEvent(oButton,'click',function (e) {
        e.stopPropagation()
        alert('Button')
    })
    addEvent(document,'click',function () {
        alert('document')
    })


}
function fn1 (e) {
    alert('1'+this.value + e.clientX)
}
function fn2 (e) {
    alert('2'+this.value + e.clientX)
}
function fn3 (e) {
    alert('3'+this.value + e.clientX)
}*/
$(function () {
  $('#btn').toggle(function () {
    $('#box').css('background','blue');
  },function () {
    $('#box').css('background','red');
  },function () {
    $('#box').css('background','green');
  });
  $('#btn2').toggle(function () {
    $('#pox').css('background','blue');
  },function () {
    $('#pox').css('background','red');
  },function () {
    $('#pox').css('background','green');
  });
});